package org.jw.wishlist.entity.biz;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.jw.wishlist.entity.AbstractEntity;
import org.jw.wishlist.entity.Indexed;
import org.jw.wishlist.entity.source.ItemSource;

/**
 * @author Jiawei Zhao
 */
@Table(name = "biz_item")
@Entity
@SuperBuilder
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Schema(description = "清单物品")
public class Item extends AbstractEntity implements Indexed {

  @ToString.Exclude
  @ManyToOne
  @JoinColumn(name = "item_source_id")
  private ItemSource source;

  @ToString.Exclude
  @ManyToOne
  @JoinColumn(name = "wishlist_id")
  private Wishlist wishlist;

  @Schema(description = "自定义名称")
  private String customName;

  @Schema(description = "自定义描述")
  private String description;

  @Schema(description = "排序号")
  private Integer index;

}
